﻿<Window x:Class="ReportingManagement.Components.OfflineDataCutOffPoint"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="270" d:DesignWidth="340" Title="Offline Data Cuf-off Point Selector" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" MaxWidth="340" SizeToContent="Height" ResizeMode="NoResize" MinHeight="270">
    <Grid>
        <Grid.Resources>
            <Style TargetType="{x:Type RadioButton}">
                <Setter Property="Margin" Value="30,5" />
            </Style>
            <Style TargetType="{x:Type DatePicker}">
                <Setter Property="Margin" Value="5" />
            </Style>
        </Grid.Resources>
        
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Label Margin="5">
            <TextBlock TextWrapping="Wrap">
                <Bold>Please select the cut-off point.</Bold>
                <LineBreak />
                <Run>This date will determine the starting point of the downloaded data. This means that only data that will be downloaded will be from this selected date onwards.</Run>
            </TextBlock>
        </Label>
        
        <StackPanel Margin="5,10" Grid.Row="1">
            <RadioButton x:Name="rdoLastSixMonths" GroupName="OFD" Content="Since Last Six Months" IsChecked="True" />
            <RadioButton x:Name="rdoLastYear" GroupName="OFD" Content="Since Last Year" />
            <StackPanel Orientation="Horizontal">
                <RadioButton GroupName="OFD" x:Name="rdoSpecifyDate" Content="Specify Date: "/>
                <DatePicker x:Name="datePicker" IsEnabled="{Binding IsChecked, ElementName=rdoSpecifyDate}" />
            </StackPanel>
        </StackPanel>

        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="5">
            <Button x:Name="btnOK" Content="OK" IsDefault="True" Padding="20,2" Margin="5" Click="btnOK_Click" />
            <Button Grid.Column="1" Content="Cancel" IsCancel="True" Padding="20,2" Margin="0,5" />
        </StackPanel>
    </Grid>
</Window>
